package com.fcml.pattern.decorator;

/**
 * @author fcml
 * @date 2018/11/8
 */
public class App {
    public static void main(String[] args) {
        Beverage beverage = new Espresso();
        System.out.println("点一杯浓咖啡共花费：" + beverage.getDescription() + ": " + beverage.cost());

        beverage = new Milk(beverage);      //牛奶浓咖啡
        System.out.println("点一杯牛奶浓咖啡共花费：" + beverage.getDescription() + ": " + beverage.cost());

        beverage = new Milk(beverage);      //牛奶要双份
        System.out.println("点一杯牛奶(双倍)浓咖啡共花费：" + beverage.getDescription() + ": " + beverage.cost());

        beverage = new Soy(beverage);       //再加一份黄豆吧
        System.out.println("点一杯黄豆牛奶(双倍)浓咖啡共花费：" + beverage.getDescription() + ": " + beverage.cost());

        System.out.println("--------------------------------");

        Beverage houseBlend = new HouseBlend();
        System.out.println("点一杯综合咖啡共花费：" + houseBlend.getDescription() + ": " + houseBlend.cost());

        houseBlend = new Mocha(houseBlend);
        houseBlend = new Milk(houseBlend);
        System.out.println("点一杯牛奶摩卡综合咖啡共花费：" + houseBlend.getDescription() + ": " + houseBlend.cost());

    }
}
